package com.fjn.mapper;

import com.fjn.pojo.Employee;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class EmployeeMapperImpl implements EmployeeMapper{
//    原来我们叫sqlSession，现在用SqlSessionTemplate
    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    @Override
    public List<Employee> getEmp() {
        EmployeeMapper mapper = sqlSession.getMapper(EmployeeMapper.class);
        return mapper.getEmp();
    }
}
